UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LYB1Rxyp1SzAtugBfz20/0PRVL4cF9kFdX9gstiZuEM='
WHERE
key_id = 'e0a8f90ed5017c7095066765b405a77ba04a635cace3d802f71cdd1799c4c657'
AND (
token = 'LYB1Rxyp1SzAtugBfz20/0PRVL4cF9kFdX9gstiZuEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)