UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dY/Xo4Nke2CEvhE6SOVAaPqNggNS9gjZebK5zdg9n7U='
WHERE
key_id = 'a03af8dd905340911b5df420490f17b436f07d0ca4c8d27f693be72d98aea9c2'
AND (
token = 'dY/Xo4Nke2CEvhE6SOVAaPqNggNS9gjZebK5zdg9n7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)