UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xw2mLETESAO9No3hyszp4wA72jByVqNEjWqk/Ep4UMo='
WHERE
key_id = 'e57b94fb07ef6166a4253dcbb87c815f09c6b40c0ba7b3033935215cb9e4064f'
AND (
token = 'xw2mLETESAO9No3hyszp4wA72jByVqNEjWqk/Ep4UMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)