UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r5Cblh3tdyvVqirb0GVfIMgRClF+cg1Y12jIzd1hveQ='
WHERE
key_id = '0dcb3df579c70f630d556f41a6204f2719c21b87a1028a43b1400a50bd3dcc68'
AND (
token = 'r5Cblh3tdyvVqirb0GVfIMgRClF+cg1Y12jIzd1hveQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)