UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3P0zAAeCYSDo24yidB5Lxpb6x6/OCWn9IzVC9f4KvbQ='
WHERE
key_id = '018a0ea671e31e3728785f514c1a354000514f17690f73c47bfbffc750f2693f'
AND (
token = '3P0zAAeCYSDo24yidB5Lxpb6x6/OCWn9IzVC9f4KvbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)