UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MykKO3RKrlCipY0VxL+fel6pTl/UVaEiX6Q0yiMfxXc=' 
WHERE 
  key_id = '2b38fcb5f7c0b3b1e63363c1a6f3235e958e0fd8031a0c50ed42fe02aad064aa' 
  AND (
    token = 'MykKO3RKrlCipY0VxL+fel6pTl/UVaEiX6Q0yiMfxXc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048