UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Ypa4peNDvS/mPtNPJhjF2n/CV8VKBGvY27/liaUvQQ='
WHERE
key_id = '3c09093376496f5921c91272d23b2d75e465745f8d802416c8dce72008f8a752'
AND (
token = '0Ypa4peNDvS/mPtNPJhjF2n/CV8VKBGvY27/liaUvQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)