UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QgNDTUwbCVoxZhfg7qUKAb8wFzAbnIfIR/wfYZhY/ac=' 
WHERE 
  key_id = '0a31330156b3f8439bc3d524b17f9cc95acbbec679f9ce7e458016e0792695bb' 
  AND (
    token = 'QgNDTUwbCVoxZhfg7qUKAb8wFzAbnIfIR/wfYZhY/ac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027