UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qz980FXIwcv3loHiIMZUvSfun4l/buqBUz3YgVVrwoQ='
WHERE
key_id = 'b37c389186a578fef47a873b36f30ba24c1e894b28bb539c05e00f6865e1ca43'
AND (
token = 'qz980FXIwcv3loHiIMZUvSfun4l/buqBUz3YgVVrwoQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)