UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '34LaaAjj0/mnRakyHkmTel2khQ9wFK4uYQN6et8w5wA='
WHERE
key_id = 'e11025fd5f272c68048a6672162dfeca0c453adc25be30e86c4312049b46c174'
AND (
token = '34LaaAjj0/mnRakyHkmTel2khQ9wFK4uYQN6et8w5wA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)