UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hCu/ZPKLoad19guVsOBdpxqRpcogJKdHOlLDV8IJsTo='
WHERE
key_id = 'b0f618cd617a0feb2cdcbf2d113f3848428e91df8a6d0bb329db807f2590ae8b'
AND (
token = 'hCu/ZPKLoad19guVsOBdpxqRpcogJKdHOlLDV8IJsTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)