UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+BpwFlIPu/uYOg5YOaeLppJME1gCSOGGFeTtEptpvBI='
WHERE
key_id = 'fc265823e1a74af0f738bc91c339e68d44e38c1f6d13762a80f08750ef12b5d4'
AND (
token = '+BpwFlIPu/uYOg5YOaeLppJME1gCSOGGFeTtEptpvBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)